<?php

class Engine_Db_SchemaData {
	
	protected $db;
	
	public function __construct($db) {
		if ($db != null)
			$this->db = $db;
		else 
			$this->db = null;	
		$this->init();
	} 
	
	public function init() {
		
	}
	
	public function insertData() {
		$result = false;
		if ($this->db != null) {
			
			$this->insert_config();
			$this->insert_blacklist();
			$this->insert_users();
			$this->insert_acl();
			$this->insert_modules();
			$this->insert_plugins();
			$this->insert_routes();
			
			$result = true;
		}
		return $result;
	}
	
	/**
	 * 
	 * Insert array of SQL statements in a database transaction.  If an error is encountered, then
	 * an exceptions is created and pushed all the way back to the calling methods.  Should be
	 * caught at the Engine_Db_Schema level.
	 * 
	 * @param array $sql
	 * @param string $table
	 * @throws Exception
	 */
	protected function executeTransaction(&$sql, &$table) {
		$this->db->beginTransaction();
		try {
			foreach($sql as $statement) {
				$this->db->query($statement);
			}
			$this->db->commit();
		} catch (Exception $e) {
			$this->db->rollback;
			throw new Exception("SchemaData::executeTransaction $table", 10100); // Push an exception
		}
	}
	
	protected function insert_config() {
		$table = CORE_CONFIG;
		$sql[] = "INSERT INTO $table (config_key, config_value)	VALUES ('db_version', '0.0.1');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('site_domain','webjestic.net');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('site_name','webJestic CMS');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('site_name_in_title',FALSE);";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('site_timezone','America/New_York');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('site_salt','SALT');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('format_datetime', 'Y-m-d h:i:s A');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('format_date', 'Y-m-d');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('format_time', 'h:i:s A');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('smtp_server', 'smtp.gmail.com');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('smtp_ssl', 'tls');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('smtp_port', 587);";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('smtp_username', 'webmaster@webjestic.net');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('smtp_password', 'PASSWORD');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('smtp_auth', 'login');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('smtp_enabled', TRUE);";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('smtp_sender_address', 'webjestic@gmail.com');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('smtp_sender_name', 'webJestic CMS');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('captcha_enabled', FALSE);";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('captcha_public_key', '');";
		$sql[] = "INSERT INTO $table (config_key, config_value) VALUES ('captcha_private_key', '');";
		$this->executeTransaction($sql, $table);
	}
	
	protected function insert_blacklist() {
		$table = CORE_BLACKLIST;
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('administrator','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('sysadmin','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('sysop','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('bitch','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('bastard','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('fuck','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('fucks','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('fucker','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('fuckers','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('fucking','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('fuckhead','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('shit','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('shits','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('shitty','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('shithead','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('shitshead','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('shitsheads','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('goddamn','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('damn','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('damned','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('master','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('mysql','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('zend','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('jesus','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('lord','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('lordjesus','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('satan','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('lordsatan','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('lucifer','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('devil','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('hell','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('hate','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('hateful','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('guest','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('member','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('author','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('editor','user'); ";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('template','user'); ";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('templates','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('user','user'); ";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('users','user'); ";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('mobile','user');  ";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('blog','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('blogs','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('profile','user');";
		$sql[] = "INSERT INTO $table (blacklist_value, blacklist_type) VALUES ('profiles','user');";
		$this->executeTransaction($sql, $table);
	}
	
	protected function insert_users() {
		$users = CORE_USERS;
		$sql[] = 
		"INSERT INTO core_users (user_username, user_email, user_password, user_firstname, user_lastname, user_verification_code, user_params, user_update_date, user_password_date, user_login_date, user_last_ip) 
		VALUES ('admin', 'webmaster@webjestic.net', MD5('passwordSALT'), 'System', 'Admin', '', 'a:0:{}', NOW(), NOW(), NOW(), '127.0.0.1');";
				$this->executeTransaction($sql, $users);
	}
	
	protected function insert_acl() {
		$roles 		= ACL_ROLES;
		$resources 	= ACL_RESOURCES;
		$users 		= ACL_USER_ROLES;
		$access 	= ACL_ACCESS;
		
		$sql[] = "INSERT INTO $roles (role_name) VALUES ('guest');";  //	-- 1000
		$sql[] = "INSERT INTO $roles (role_name) VALUES ('member');";  //	-- 1001
		$sql[] = "INSERT INTO $roles (role_name) VALUES ('author');";  //	-- 1002
		$sql[] = "INSERT INTO $roles (role_name) VALUES ('editor');";  //	-- 1003
		$sql[] = "INSERT INTO $roles (role_name) VALUES ('admin');";  //	-- 1004
		
		$sql[] = "INSERT INTO $users (user_role_user_id, user_role_role_id) VALUES (1000,1000);";
		$sql[] = "INSERT INTO $users (user_role_user_id, user_role_role_id) VALUES (1000,1001);";
		$sql[] = "INSERT INTO $users (user_role_user_id, user_role_role_id) VALUES (1000,1002);";
		$sql[] = "INSERT INTO $users (user_role_user_id, user_role_role_id) VALUES (1000,1003);";
		$sql[] = "INSERT INTO $users (user_role_user_id, user_role_role_id) VALUES (1000,1004);";
		
		$sql[] = "INSERT INTO $resources (resource_name) VALUES ('admin/index/index'); ";
		$sql[] = "INSERT INTO $access (access_resource_id, access_role_id, access_allow) VALUES (1000, 1000, FALSE);";
		$sql[] = "INSERT INTO $access (access_resource_id, access_role_id, access_allow) VALUES (1000, 1001, FALSE);";
		$sql[] = "INSERT INTO $access (access_resource_id, access_role_id, access_allow) VALUES (1000, 1002, TRUE);";
		$sql[] = "INSERT INTO $access (access_resource_id, access_role_id, access_allow) VALUES (1000, 1003, TRUE);";
		$sql[] = "INSERT INTO $access (access_resource_id, access_role_id, access_allow) VALUES (1000, 1004, TRUE);";
		
		$sql[] = "INSERT INTO $resources(resource_name) VALUES ('admin/content/index');";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1001, 1000, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1001, 1001, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1001, 1002, TRUE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1001, 1003, TRUE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1001, 1004, TRUE);";
		
		$sql[] = "INSERT INTO $resources(resource_name) VALUES ('admin/users/index');";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1002, 1000, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1002, 1001, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1002, 1002, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1002, 1003, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1002, 1004, TRUE);";
		
		$sql[] = "INSERT INTO $resources(resource_name) VALUES ('admin/application/index');";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1003, 1000, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1003, 1001, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1003, 1002, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1003, 1003, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1003, 1004, TRUE);";
		
		$sql[] = "INSERT INTO $resources(resource_name) VALUES ('admin/security/index');";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1004, 1000, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1004, 1001, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1004, 1002, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1004, 1003, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1004, 1004, TRUE);";
		
		$sql[] = "INSERT INTO $resources(resource_name) VALUES ('admin/application/modules');";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1005, 1000, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1005, 1001, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1005, 1002, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1005, 1003, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1005, 1004, TRUE);";
		
		$sql[] = "INSERT INTO $resources(resource_name) VALUES ('admin/application/plugins');";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1006, 1000, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1006, 1001, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1006, 1002, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1006, 1003, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1006, 1004, TRUE);";
		
		$sql[] = "INSERT INTO $resources(resource_name) VALUES ('admin/application/appearance');";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1007, 1000, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1007, 1001, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1007, 1002, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1007, 1003, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1007, 1004, TRUE);";
		
		$sql[] = "INSERT INTO $resources(resource_name) VALUES ('admin/application/navigation');";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1008, 1000, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1008, 1001, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1008, 1002, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1008, 1003, FALSE);";
		$sql[] = "INSERT INTO $access(access_resource_id, access_role_id, access_allow) VALUES (1008, 1004, TRUE);";

		$sql[] = "INSERT INTO acl_resources(resource_name) VALUES ('admin/application/widgets');";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1009, 1000, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1009, 1001, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1009, 1002, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1009, 1003, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1009, 1004, TRUE);";

		$sql[] = "INSERT INTO acl_resources(resource_name) VALUES ('admin/mobile/index');";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1010, 1000, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1010, 1001, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1010, 1002, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1010, 1003, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1010, 1004, TRUE);";

		$sql[] = "INSERT INTO acl_resources(resource_name) VALUES ('admin/application/helpers');";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1011, 1000, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1011, 1001, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1011, 1002, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1011, 1003, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1011, 1004, TRUE);";

		$sql[] = "INSERT INTO acl_resources(resource_name) VALUES ('admin/application/settings');";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1012, 1000, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1012, 1001, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1012, 1002, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1012, 1003, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1012, 1004, TRUE);";

		$sql[] = "INSERT INTO acl_resources(resource_name) VALUES ('admin/content/pages');";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1013, 1000, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1013, 1001, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1013, 1002, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1013, 1003, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1013, 1004, TRUE);";

		$sql[] = "INSERT INTO acl_resources(resource_name) VALUES ('admin/content/home');";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1014, 1000, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1014, 1001, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1014, 1002, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1014, 1003, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1014, 1004, TRUE);";

		$sql[] = "INSERT INTO acl_resources(resource_name) VALUES ('admin/application/database');";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1015, 1000, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1015, 1001, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1015, 1002, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1015, 1003, FALSE);";
		$sql[] = "INSERT INTO acl_access(access_resource_id, access_role_id, access_allow) VALUES (1015, 1004, TRUE);";	
		
		$this->executeTransaction($sql, $roles);
	}
	
	protected function insert_modules() {
		$table = CORE_MODULES;
		$sql[] = "INSERT INTO $table (module_name, module_layout) VALUES ('default', 'default');"; //	-- 1000
		$sql[] = "INSERT INTO $table (module_name, module_layout) VALUES ('user', 'default');";	 // -- 1001
		$sql[] = "INSERT INTO $table (module_name, module_layout) VALUES ('admin', 'admin');";	// -- 1002
		$sql[] = "INSERT INTO $table (module_name, module_layout) VALUES ('mobile', 'mobile');"; // -- 1003
		$sql[] = "INSERT INTO $table (module_name, module_layout) VALUES ('facebook', 'default');";	// -- 1004
		$this->executeTransaction($sql, $table);
	}
	
	protected function insert_plugins() {
		$table = CORE_PLUGINS;
		$sql[] = "INSERT INTO $table (plugin_classname, plugin_name, plugin_active, plugin_stackindex, plugin_options)
				VALUES ('Engine_Controller_Plugin_Blacklist', 'Blacklist', TRUE, 0, 'a:0:{}');";
		
		$sql[] = "INSERT INTO $table (plugin_classname, plugin_name, plugin_active, plugin_stackindex, plugin_options)
				VALUES ('Engine_Controller_Plugin_Routes', 'Routes', TRUE, 1, 'a:0:{}');";
		
		$sql[] = "INSERT INTO $table (plugin_classname, plugin_name, plugin_active, plugin_stackindex, plugin_options)
				VALUES ('Engine_Controller_Plugin_Acl', 'ACL', TRUE, 2, 'a:0:{}');";
		$this->executeTransaction($sql, $table);
	}
	
	protected function insert_routes() {
		$table = CORE_ROUTES;
		$sql[] = "INSERT INTO core_routes (route_module_id, route_name, route_uri, route_controller, route_action)
				VALUES (1001, 'userUserName', '/user/:username', 'index', 'profile');";

		$sql[] = "INSERT INTO core_routes (route_module_id, route_name, route_uri, route_controller, route_action)
				VALUES (1001, 'userLogin', '/user/login', 'index', 'login');";

		$sql[] = "INSERT INTO core_routes (route_module_id, route_name, route_uri, route_controller, route_action)
				VALUES (1001, 'userLogout', '/user/logout', 'index', 'logout');";

		$sql[] = "INSERT INTO core_routes (route_module_id, route_name, route_uri, route_controller, route_action)
				VALUES (1001, 'userUnauthorized', '/user/unauthorized', 'index', 'unauthorized');";

		$sql[] = "INSERT INTO core_routes (route_module_id, route_name, route_uri, route_controller, route_action)
				VALUES (1001, 'userInactive', '/user/inactive', 'index', 'inactive');";

		$sql[] = "INSERT INTO core_routes (route_module_id, route_name, route_uri, route_controller, route_action)
				VALUES (1001, 'userPofile', '/user/profile', 'index', 'profile');";

		$sql[] = "INSERT INTO core_routes (route_module_id, route_name, route_uri, route_controller, route_action)
				VALUES (1001, 'userRegister', '/user/register', 'index', 'register');";

		$sql[] = "INSERT INTO core_routes (route_module_id, route_name, route_uri, route_controller, route_action)
				VALUES (1001, 'userRegisterVerify', '/user/register/verify', 'index', 'verify');";

		
		$this->executeTransaction($sql, $table);
	}
	
}

?>